package edu.bbu.commonproject.desktop.gui.view.swing.login;

import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Image;

import javax.swing.ImageIcon;
import javax.swing.JButton;

import edu.bbu.commonproject.desktop.gui.view.swing.utils.Design;
import edu.bbu.commonproject.desktop.gui.view.swing.utils.HeaderButton;
import edu.bbu.commonproject.desktop.gui.view.swing.utils.TexturedPanel;
import edu.bbu.commonproject.desktop.gui.view.swing.utils.TransparentButton;

/**
 * The StartLogoPanel class.
 */
public class LogoPanel extends TexturedPanel
{
	/** The logo image. */
	private Image logoImage;
	
	/** The logo texture. */
	private Image logoTexture;
	
	/** The login button icon. */
	private ImageIcon loginButtonIcon;
	
	/** The register button icon. */
	private ImageIcon registerButtonIcon;
	
	/** The forgot password icon button. */
	private ImageIcon forgotPasswordButtonIcon;
	
	/** The login button. */
	private HeaderButton loginButton;
	
	/** The register button. */
	private HeaderButton registerButton;
	
	/** The forgot password button. */
	private HeaderButton forgotPasswordButton;
	
	/**
	 * The constructor.
	 */
	public LogoPanel()
	{
		logoImage = Design.COMPONENT_LOGO;
		logoTexture = Design.COMPONENT_HEADEREXTURE;
		loginButtonIcon = new ImageIcon(Design.HEADER_BUTTON_LOGIN);
		registerButtonIcon = new ImageIcon(Design.HEADER_BUTTON_REGISTER);
		forgotPasswordButtonIcon = new ImageIcon(Design.HEADER_BUTTON_FORGOTPASSWORD);
	
		this.setTexture(logoTexture);
		this.setPreferredSize(new Dimension(900, 80));
		this.setLayout(new FlowLayout(FlowLayout.RIGHT, 2, 0));
		
		setComponents();
	}
	
	/**
	 * Sets up the components.
	 */
	private void setComponents()
	{
		loginButton = new HeaderButton();
		loginButton.setIcon(loginButtonIcon);
		
		registerButton = new HeaderButton();
		registerButton.setIcon(registerButtonIcon);
		
		forgotPasswordButton = new HeaderButton();
		forgotPasswordButton.setIcon(forgotPasswordButtonIcon);
		
		this.add(loginButton);
		this.add(registerButton);
		this.add(forgotPasswordButton);
	}

	/**
	 * Gets the login button.
	 * @return the login button.
	 */
	public JButton getLoginButton()
	{
		return loginButton;
	}
	
	/**
	 * Gets the register button.
	 * @return the register button.
	 */
	public JButton getRegisterButton()
	{
		return registerButton;
	}
	
	/**
	 * Gets the forgoton password button.
	 * @return the forgoton password button.
	 */
	public JButton getForgetButton()
	{
		return forgotPasswordButton;
	}
	
	/**
	 * The paintComponents method.
	 */
	public void paintComponent(Graphics g)
	{
		super.paintComponent(g);
		g.drawImage(logoImage, 0, 0, null);
	}
}
